'use strict';

const Controller = require('egg').Controller;

class HomeController extends Controller {
  async index() {
    const { ctx } = this;
    ctx.body = 'hi, egg';
  }
  async banner(){
    const {ctx}=this
    const bannerData =await ctx.service.home.banner()
    ctx.body={
      code:1,
      data:bannerData
    }
  }
  async menu(){
    const {ctx}=this
    const menuData =await ctx.service.home.menu()
    ctx.body={
      code:1,
      data:menuData
    }
  }
  async tab(){
    const {ctx}=this
    const tabData=await ctx.service.home.tab()
    ctx.body={
      code:1,
      data:tabData
    }
  }
}

module.exports = HomeController;
